<%@page contentType="text/html; charset=utf-8"%>
<%@ include file="../inc/TagLibs.jsp"%>
<c:set var="pageTitle" value="选择常用短语" />
<%@ include file="../inc/Title.jsp"%>
<head>
<link rel="stylesheet" type="text/css" href="/css/base.css" />
<script src="/js/popup_ext.js"></script>
<script language="javascript">
	function doNew(){
		var url="/base/SmsPhraseNew.ihtm";
		ShowIframeNoScroll("常用短语",url,500,300,"refreshWin()");
	}
	function refreshWin(){
		window.location=window.location;
	}
	function doDelete(id){
		ShowConfirm('确认框','确定删除吗？',230,80,"doDelAct("+id+")");
	}
	function doDelAct(id){
		if(popRetVal!=null){
			window.location="/base/SmsPhraseDelete.ihtm?id="+id+"&from_url="+encodeURIComponent(window.location);
		}
	}
	function doCancel(){
		parent.ClosePop();
	}
	function doSelect(index){
		var arr=new Array(document.getElementById("li_"+index).getAttribute("content"));
		parent.popRetVal=arr;
		parent.ClosePop();
	}
	
	function DoubleClick(it){
		var arr=new Array(it.getAttribute("content"));
		parent.popRetVal=arr;
		parent.ClosePop();
	}
	function showMe(){

	}
</script>
</head>
<body oncontextmenu="return false" class="sheet modal-dialog" onLoad="showMe();">
<div class="sheet-main" style="width:274px;">
  <div class="sheet-top">
    <div class="content chit">
      <h2>选择常用短语</h2>
      <p>鼠标双击可以选中记录</p>
    </div>
  </div>
  <div class="sheet-list" style="width:274px">
    <div class="search-business chit-common">
    	<c:if test="${alertMsg!=null && alertMsg!=''}">
    	<div class="msg-error" id="errorMsgTd">
	  		${alertMsg}
	  		<c:remove var="alertMsg" scope="session" />
	  	</div>
	  	</c:if>
		<div class="chit-common-info">
			<div class="chit-content" style="-webkit-overflow-scrolling:touch">
				<ul>
					<c:forEach var="item" items="${smsPhraseList}" varStatus="i">
					<li id="li_${i.index+1}" content="<c:out value="${item.content}" />" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#D1EBF9'" ondblclick='javascript:DoubleClick(this)'>
						<c:out value="${item.content}" />
						<br>
						<a href="javascript:doSelect('${i.index+1}');">选择</a><span>|</span><a href="javascript:doDelete('${item.id}');">删除</a>
					</li>
					</c:forEach>
				</ul>
				
				<input name="增加" type="button" value="增加" class="buttom" onClick="doNew();" style="float:right;"/>
			</div>
		</div>
	</div>
  </div>
</div>		

</body>
</html>